import { tuiObject } from "@/types";
import { useEffect } from "react";
import { knowledgeModelState, useDispatch, useSelector } from "umi";
import style from "./style.less"
export default function BadgeReader() {
    const Dispatch = useDispatch();
    useEffect(() => {
        Dispatch({
            type: "knowledge/articlelist",
        })
        
    }, [])
    const { tuilist } = useSelector((state: { knowledge: knowledgeModelState }) => {
        return state.knowledge
    });
    
    
    return (
        <div>
            <div className={style.tui}>
                <h2>推荐阅读</h2>
                <ul>
                    {tuilist.map((item:tuiObject) => {
                        return <li key={item.id}>{item.title}</li>
                    })}
                </ul>
            </div>
        </div>
    );
}
